home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / More Source / Libraries / VideoToolbox 95.04.18 / VideoToolboxSources / Exponential.c < prev    next >
Text File  |  1994-08-01  |  299b  |  15 lines

  1. /* Exponential.c 
  2. Routines related to the exponential probability distribution.
  3. Also see: Binomial.c, ChiSquare.c, Normal.c, Uniform.c
  4. */
  5. #include <math.h>
  6.  
  7. double ExponentialPdf(double x);
  8.  
  9. double ExponentialPdf(double x)
  10. // Mean and variance are 1.
  11. {
  12.     if(x<0.0)return 0.0;
  13.     else return exp(-x);
  14. }
  15.